
-if(mode == 'add') { var event = { _id: 0, what: '', where: '', when: '' }; }
script(type='text/javascript')
	$("body").ready(function() {$("#eventWhere")[0].value = $("#fbPlaceSearch")[0].value; });

form(
	method='post',
	action='/events',
	enctype='application/x-www-form-urlencoded')
	table
		tr
			td.neutral(colspan='2')
				h3 Edit Event
				input(type='submit',value='Save')
				input(type='hidden',name='action',value= mode)
				input(type='hidden',name='id',value=event._id)
		tr
			td.neutral.editLabel What
			td.neutral
				input(type='text',name='what',value=event.what)
		tr
			td.neutral.editLabel Where
			td.neutral
				input#fbPlaceSearch(type='text',value=event.where)
				select#fbPlaceResults(size='8', name='fbPlace')
					option(value= event.fbPlace, selected=true)= event.where
				input#eventWhere(type='hidden',name='where')
		tr
			td.neutral.editLabel When
			td.neutral
				input(type='text',name='when',value=event.when)
